STEP 14: We need our program to end AFTER the knight defeats all dragons.

The When Interval block lets us know when a win condition is met.

  • In GRAPHICS, go to and drag in When Interval to the bottom of your program.
  • Change the four times my_var appears in the interval event to the variable dragon_count.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)